<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
.AlignLeft { text-align: left; }
.AlignCenter { text-align: center; }
.AlignRight { text-align: right; }
body { font-family: sans-serif; font-size: 11pt; }
img.AutoScale { max-width: 100%; max-height: 100%; }
td { vertical-align: top; padding-left: 4px; padding-right: 4px; }

tr.SectionGap td { font-size: 4px; border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
tr.SectionAll td { border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
tr.SectionBegin td { border-left: none; border-top: none; border-right: 1px solid Black; }
tr.SectionEnd td { border-left: none; border-top: none; border-bottom: 1px solid Black; border-right: 1px solid Black; }
tr.SectionMiddle td { border-left: none; border-top: none; border-right: 1px solid Black; }
tr.SubsectionAll td { border-left: none; border-top: none; border-bottom: 1px solid Gray; border-right: 1px solid Black; }
tr.SubsectionEnd td { border-left: none; border-top: none; border-bottom: 1px solid Gray; border-right: 1px solid Black; }
table.fc { border-top: 1px solid Black; border-left: 1px solid Black; width: 100%; font-family: monospace; font-size: 10pt; }
td.TextItemInsigMod { color: #000000; background-color: #EEEEFF; }
td.TextItemInsigOrphan { color: #000000; background-color: #FAEEFF; }
td.TextItemNum { color: #696969; background-color: #F0F0F0; }
td.TextItemSame { color: #000000; background-color: #FFFFFF; }
td.TextItemSigMod { color: #000000; background-color: #FFE3E3; }
td.TextItemSigOrphan { color: #000000; background-color: #F1E3FF; }
.TextSegInsigDiff { color: #0000FF; }
.TextSegReplacedDiff { color: #0000FF; font-style: italic; }
.TextSegSigDiff { color: #FF0000; }
td.TextItemInsigAdd { color: #000000; background-color: #EEEEFF; }
td.TextItemInsigDel { color: #000000; background-color: #EEEEFF; text-decoration: line-through; }
td.TextItemSigAdd { color: #000000; background-color: #FFE3E3; }
td.TextItemSigDel { color: #000000; background-color: #FFE3E3; text-decoration: line-through; }
.TextSegElementKeyword { font-weight: bold; }
.TextSegElementIdentifier { }
.TextSegElementNumber { color: #2E9269; }
.TextSegElementString { color: #3A7726; }
.TextSegElementCompiler_32Directive { color: #681717; }
.TextSegElementComment { color: #786A41; }
.TextSegElementOperator { }
</style>
<title>Compare Windows-driver-samples\usb\kmdf_fx2 to DMF\DmfSamples\kmdf_fx2_dmf</title>
</head>
<body>
Compare Windows-driver-samples\usb\kmdf_fx2 to DMF\DmfSamples\kmdf_fx2_dmf<br>

&nbsp; &nbsp;
<br>
Mode:&nbsp; All &nbsp;
<br>
Left file: Windows-driver-samples\usb\kmdf_fx2\driver\interrupt.c &nbsp;
<br>
Right file: DMF\DmfSamples\kmdf_fx2_dmf\driver_dmf_1\interrupt.c &nbsp;
<br>
<table class="fc" cellspacing="0" cellpadding="0">
<tr class="SectionBegin">
<td class="TextItemSame"><span class="TextSegElementComment">/*++</span></td>
<td class="AlignCenter">=</td>
<td class="TextItemSame"><span class="TextSegElementComment">/*++</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Copyright (c) Microsoft Corporation.&nbsp; All rights reserved.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Copyright (c) Microsoft Corporation.&nbsp; All rights reserved.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; THIS CODE AND INFORMATION IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; THIS CODE AND INFORMATION IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; PURPOSE.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; PURPOSE.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Module Name:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Module Name:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Interrupt.c</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Interrupt.c</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Abstract:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Abstract:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; This modules has routines configure a continuous reader on an</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; This modules has routines configure a continuous reader on an</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; interrupt pipe to asynchronously read toggle switch states.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; interrupt pipe to asynchronously read toggle switch states.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Environment:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Environment:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Kernel mode</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Kernel mode</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">--*/</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">--*/</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementCompiler_32Directive">#include</span> <span class="TextSegElementOperator">&lt;</span><span class="TextSegElementIdentifier">osrusbfx2</span><span class="TextSegElementOperator">.</span><span class="TextSegElementIdentifier">h</span><span class="TextSegElementOperator">&gt;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementCompiler_32Directive">#include</span> <span class="TextSegElementOperator">&lt;</span><span class="TextSegElementIdentifier">osrusbfx2</span><span class="TextSegElementOperator">.</span><span class="TextSegElementIdentifier">h</span><span class="TextSegElementOperator">&gt;</span></td>
</tr>
<tr class="SectionEnd">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionAll">
<td class="TextItemSigMod"><span class="TextSegSigDiff">#if</span><span class="TextSegInsigDiff"> </span><span class="TextSegSigDiff">defined</span><span class="TextSegSigDiff">(</span><span class="TextSegSigDiff">EVENT_TRACING</span><span class="TextSegSigDiff">)</span></td>
<td class="AlignCenter">+-</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionAll">
<td class="TextItemSame"><span class="TextSegElementCompiler_32Directive">#include</span> <span class="TextSegElementString">&quot;interrupt.tmh&quot;</span></td>
<td class="AlignCenter">=</td>
<td class="TextItemSame"><span class="TextSegElementCompiler_32Directive">#include</span> <span class="TextSegElementString">&quot;interrupt.tmh&quot;</span></td>
</tr>
<tr class="SectionBegin">
<td class="TextItemSigMod"><span class="TextSegSigDiff">#endif</span></td>
<td class="AlignCenter">+-</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionEnd">
<td class="TextItemInsigMod">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionBegin">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">=</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementIdentifier">_IRQL_requires_</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">PASSIVE_LEVEL</span><span class="TextSegElementOperator">)</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementIdentifier">_IRQL_requires_</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">PASSIVE_LEVEL</span><span class="TextSegElementOperator">)</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementIdentifier">NTSTATUS</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementIdentifier">NTSTATUS</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementIdentifier">OsrFxConfigContReaderForInterruptEndPoint</span><span class="TextSegElementOperator">(</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementIdentifier">OsrFxConfigContReaderForInterruptEndPoint</span><span class="TextSegElementOperator">(</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">PDEVICE_CONTEXT</span> <span class="TextSegElementIdentifier">DeviceContext</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">PDEVICE_CONTEXT</span> <span class="TextSegElementIdentifier">DeviceContext</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">)</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">)</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">/*++</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">/*++</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Routine Description:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Routine Description:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; This routine configures a continuous reader on the</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; This routine configures a continuous reader on the</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; interrupt endpoint. It's called from the PrepareHarware event.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; interrupt endpoint. It's called from the PrepareHarware event.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Arguments:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Arguments:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Return Value:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Return Value:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; NT status value</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; NT status value</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">--*/</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">--*/</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementOperator">{</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementOperator">{</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDF_USB_CONTINUOUS_READER_CONFIG</span> <span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDF_USB_CONTINUOUS_READER_CONFIG</span> <span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">NTSTATUS</span> <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">NTSTATUS</span> <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDF_USB_CONTINUOUS_READER_CONFIG_INIT</span><span class="TextSegElementOperator">(&amp;</span><span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDF_USB_CONTINUOUS_READER_CONFIG_INIT</span><span class="TextSegElementOperator">(&amp;</span><span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptPipeReadComplete</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptPipeReadComplete</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">DeviceContext</span><span class="TextSegElementOperator">,</span>&nbsp; &nbsp; <span class="TextSegElementComment">// Context</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">DeviceContext</span><span class="TextSegElementOperator">,</span>&nbsp; &nbsp; <span class="TextSegElementComment">// Context</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementKeyword">sizeof</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">UCHAR</span><span class="TextSegElementOperator">));</span>&nbsp;&nbsp; <span class="TextSegElementComment">// TransferLength</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementKeyword">sizeof</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">UCHAR</span><span class="TextSegElementOperator">));</span>&nbsp;&nbsp; <span class="TextSegElementComment">// TransferLength</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">.</span><span class="TextSegElementIdentifier">EvtUsbTargetPipeReadersFailed</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptReadersFailed</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">.</span><span class="TextSegElementIdentifier">EvtUsbTargetPipeReadersFailed</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptReadersFailed</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Reader requests are not posted to the target automatically.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Reader requests are not posted to the target automatically.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Driver must explictly call WdfIoTargetStart to kick start the</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Driver must explictly call WdfIoTargetStart to kick start the</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// reader.&nbsp; In this sample, it's done in D0Entry.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// reader.&nbsp; In this sample, it's done in D0Entry.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// By defaut, framework queues two requests to the target</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// By defaut, framework queues two requests to the target</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// endpoint. Driver can configure up to 10 requests with CONFIG macro.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// endpoint. Driver can configure up to 10 requests with CONFIG macro.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">status</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfUsbTargetPipeConfigContinuousReader</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">DeviceContext</span><span class="TextSegElementOperator">-&gt;</span><span class="TextSegElementIdentifier">InterruptPipe</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">status</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfUsbTargetPipeConfigContinuousReader</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">DeviceContext</span><span class="TextSegElementOperator">-&gt;</span><span class="TextSegElementIdentifier">InterruptPipe</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementOperator">&amp;</span><span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementOperator">&amp;</span><span class="TextSegElementIdentifier">contReaderConfig</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">if</span> <span class="TextSegElementOperator">(!</span><span class="TextSegElementIdentifier">NT_SUCCESS</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">))</span> <span class="TextSegElementOperator">{</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">if</span> <span class="TextSegElementOperator">(!</span><span class="TextSegElementIdentifier">NT_SUCCESS</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">))</span> <span class="TextSegElementOperator">{</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">TraceEvents</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">TRACE_LEVEL_ERROR</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">DBG_PNP</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">TraceEvents</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">TRACE_LEVEL_ERROR</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">DBG_PNP</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;OsrFxConfigContReaderForInterruptEndPoint failed %x\n&quot;</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;OsrFxConfigContReaderForInterruptEndPoint failed %x\n&quot;</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementKeyword">return</span> <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementKeyword">return</span> <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">}</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">}</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">return</span> <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">return</span> <span class="TextSegElementIdentifier">status</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementOperator">}</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementOperator">}</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementIdentifier">VOID</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementIdentifier">VOID</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptPipeReadComplete</span><span class="TextSegElementOperator">(</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptPipeReadComplete</span><span class="TextSegElementOperator">(</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFUSBPIPE</span>&nbsp; <span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFUSBPIPE</span>&nbsp; <span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFMEMORY</span>&nbsp;&nbsp; <span class="TextSegElementIdentifier">Buffer</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFMEMORY</span>&nbsp;&nbsp; <span class="TextSegElementIdentifier">Buffer</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">size_t</span>&nbsp; &nbsp; &nbsp; <span class="TextSegElementIdentifier">NumBytesTransferred</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">size_t</span>&nbsp; &nbsp; &nbsp; <span class="TextSegElementIdentifier">NumBytesTransferred</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFCONTEXT</span>&nbsp; <span class="TextSegElementIdentifier">Context</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFCONTEXT</span>&nbsp; <span class="TextSegElementIdentifier">Context</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">)</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">)</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">/*++</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">/*++</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Routine Description:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Routine Description:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; This the completion routine of the continour reader. This can</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; This the completion routine of the continour reader. This can</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; called concurrently on multiprocessor system if there are</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; called concurrently on multiprocessor system if there are</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; more than one readers configured. So make sure to protect</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; more than one readers configured. So make sure to protect</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; access to global resources.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; access to global resources.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Arguments:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Arguments:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Buffer - This buffer is freed when this call returns.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Buffer - This buffer is freed when this call returns.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If the driver wants to delay processing of the buffer, it</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If the driver wants to delay processing of the buffer, it</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; can take an additional referrence.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; can take an additional referrence.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Context - Provided in the WDF_USB_CONTINUOUS_READER_CONFIG_INIT macro</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; Context - Provided in the WDF_USB_CONTINUOUS_READER_CONFIG_INIT macro</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">Return Value:</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">Return Value:</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; NT status value</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">&nbsp;&nbsp;&nbsp; NT status value</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementComment">--*/</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementComment">--*/</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementOperator">{</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementOperator">{</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">PUCHAR</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="TextSegElementIdentifier">switchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">NULL</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">PUCHAR</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="TextSegElementIdentifier">switchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">NULL</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFDEVICE</span>&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFDEVICE</span>&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">PDEVICE_CONTEXT</span> <span class="TextSegElementIdentifier">pDeviceContext</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">Context</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">PDEVICE_CONTEXT</span> <span class="TextSegElementIdentifier">pDeviceContext</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">Context</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">UNREFERENCED_PARAMETER</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">UNREFERENCED_PARAMETER</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">device</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfObjectContextGetObject</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">pDeviceContext</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">device</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfObjectContextGetObject</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">pDeviceContext</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Make sure that there is data in the read packet.&nbsp; Depending on the device</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Make sure that there is data in the read packet.&nbsp; Depending on the device</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// specification, it is possible for it to return a 0 length read in</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// specification, it is possible for it to return a 0 length read in</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// certain conditions.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// certain conditions.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">if</span> <span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">NumBytesTransferred</span> <span class="TextSegElementOperator">==</span> <span class="TextSegElementNumber">0</span><span class="TextSegElementOperator">)</span> <span class="TextSegElementOperator">{</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">if</span> <span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">NumBytesTransferred</span> <span class="TextSegElementOperator">==</span> <span class="TextSegElementNumber">0</span><span class="TextSegElementOperator">)</span> <span class="TextSegElementOperator">{</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">TraceEvents</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">TRACE_LEVEL_WARNING</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">DBG_INIT</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementIdentifier">TraceEvents</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">TRACE_LEVEL_WARNING</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">DBG_INIT</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;OsrFxEvtUsbInterruptPipeReadComplete Zero length read &quot;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;OsrFxEvtUsbInterruptPipeReadComplete Zero length read &quot;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;occured on the Interrupt Pipe's Continuous Reader\n&quot;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;occured on the Interrupt Pipe's Continuous Reader\n&quot;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementKeyword">return</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementKeyword">return</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">}</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">}</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">NT_ASSERT</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">NumBytesTransferred</span> <span class="TextSegElementOperator">==</span> <span class="TextSegElementKeyword">sizeof</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">UCHAR</span><span class="TextSegElementOperator">));</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">NT_ASSERT</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">NumBytesTransferred</span> <span class="TextSegElementOperator">==</span> <span class="TextSegElementKeyword">sizeof</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">UCHAR</span><span class="TextSegElementOperator">));</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">switchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfMemoryGetBuffer</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">Buffer</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">NULL</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">switchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfMemoryGetBuffer</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">Buffer</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">NULL</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">TraceEvents</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">TRACE_LEVEL_INFORMATION</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">DBG_INIT</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">TraceEvents</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">TRACE_LEVEL_INFORMATION</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">DBG_INIT</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;OsrFxEvtUsbInterruptPipeReadComplete SwitchState %x\n&quot;</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementString">&quot;OsrFxEvtUsbInterruptPipeReadComplete SwitchState %x\n&quot;</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementOperator">*</span><span class="TextSegElementIdentifier">switchState</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span class="TextSegElementOperator">*</span><span class="TextSegElementIdentifier">switchState</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">pDeviceContext</span><span class="TextSegElementOperator">-&gt;</span><span class="TextSegElementIdentifier">CurrentSwitchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementOperator">*</span><span class="TextSegElementIdentifier">switchState</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">pDeviceContext</span><span class="TextSegElementOperator">-&gt;</span><span class="TextSegElementIdentifier">CurrentSwitchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementOperator">*</span><span class="TextSegElementIdentifier">switchState</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Handle any pending Interrupt Message IOCTLs. Note that the OSR USB device</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Handle any pending Interrupt Message IOCTLs. Note that the OSR USB device</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// will generate an interrupt message when the the device resumes from a low</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// will generate an interrupt message when the the device resumes from a low</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// power state. So if the Interrupt Message IOCTL was sent after the device</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// power state. So if the Interrupt Message IOCTL was sent after the device</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// has gone to a low power state, the pending Interrupt Message IOCTL will</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// has gone to a low power state, the pending Interrupt Message IOCTL will</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// get completed in the function call below, before the user twiddles the</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// get completed in the function call below, before the user twiddles the</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// dip switches on the OSR USB device. If this is not the desired behavior</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// dip switches on the OSR USB device. If this is not the desired behavior</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// for your driver, then you could handle this condition by maintaining a</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// for your driver, then you could handle this condition by maintaining a</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// state variable on D0Entry to track interrupt messages caused by power up.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// state variable on D0Entry to track interrupt messages caused by power up.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">OsrUsbIoctlGetInterruptMessage</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">STATUS_SUCCESS</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">OsrUsbIoctlGetInterruptMessage</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">STATUS_SUCCESS</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementOperator">}</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementOperator">}</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementIdentifier">BOOLEAN</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementIdentifier">BOOLEAN</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptReadersFailed</span><span class="TextSegElementOperator">(</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementIdentifier">OsrFxEvtUsbInterruptReadersFailed</span><span class="TextSegElementOperator">(</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">WDFUSBPIPE</span> <span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">WDFUSBPIPE</span> <span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">NTSTATUS</span> <span class="TextSegElementIdentifier">Status</span><span class="TextSegElementOperator">,</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">NTSTATUS</span> <span class="TextSegElementIdentifier">Status</span><span class="TextSegElementOperator">,</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">USBD_STATUS</span> <span class="TextSegElementIdentifier">UsbdStatus</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">_In_</span> <span class="TextSegElementIdentifier">USBD_STATUS</span> <span class="TextSegElementIdentifier">UsbdStatus</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">)</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementOperator">)</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementOperator">{</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementOperator">{</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFDEVICE</span> <span class="TextSegElementIdentifier">device</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfIoTargetGetDevice</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">WdfUsbTargetPipeGetIoTarget</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">));</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">WDFDEVICE</span> <span class="TextSegElementIdentifier">device</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">WdfIoTargetGetDevice</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">WdfUsbTargetPipeGetIoTarget</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">Pipe</span><span class="TextSegElementOperator">));</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">PDEVICE_CONTEXT</span> <span class="TextSegElementIdentifier">pDeviceContext</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">GetDeviceContext</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">PDEVICE_CONTEXT</span> <span class="TextSegElementIdentifier">pDeviceContext</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementIdentifier">GetDeviceContext</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">UNREFERENCED_PARAMETER</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">UsbdStatus</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">UNREFERENCED_PARAMETER</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">UsbdStatus</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Clear the current switch state.</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Clear the current switch state.</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">pDeviceContext</span><span class="TextSegElementOperator">-&gt;</span><span class="TextSegElementIdentifier">CurrentSwitchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementNumber">0</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">pDeviceContext</span><span class="TextSegElementOperator">-&gt;</span><span class="TextSegElementIdentifier">CurrentSwitchState</span> <span class="TextSegElementOperator">=</span> <span class="TextSegElementNumber">0</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Service the pending interrupt switch change request</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">// Service the pending interrupt switch change request</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementComment">//</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">OsrUsbIoctlGetInterruptMessage</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">Status</span><span class="TextSegElementOperator">);</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementIdentifier">OsrUsbIoctlGetInterruptMessage</span><span class="TextSegElementOperator">(</span><span class="TextSegElementIdentifier">device</span><span class="TextSegElementOperator">,</span> <span class="TextSegElementIdentifier">Status</span><span class="TextSegElementOperator">);</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">return</span> <span class="TextSegElementIdentifier">TRUE</span><span class="TextSegElementOperator">;</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;&nbsp;&nbsp; <span class="TextSegElementKeyword">return</span> <span class="TextSegElementIdentifier">TRUE</span><span class="TextSegElementOperator">;</span></td>
</tr>
<tr class="SectionMiddle">
<td class="TextItemSame"><span class="TextSegElementOperator">}</span></td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame"><span class="TextSegElementOperator">}</span></td>
</tr>
<tr class="SectionEnd">
<td class="TextItemSame">&nbsp;</td>
<td class="AlignCenter">&nbsp;</td>
<td class="TextItemSame">&nbsp;</td>
</tr>
</table>
<br>
</body>
</html>
